package jiang.jvm;

/**
 * @ClassName SubSon
 * @Description: 类初始化测试父类
 * @Author jiangshitao
 * @Date 2023/3/6
 */
public class SubSon extends FatherClass{
    // 静态变量
    public static String son_StaticField = "子类--静态变量";
    /**
     * 变量
      */
    public String sonField = "子类--变量";
    // 静态初始化块
    static {
        System.out.println(son_StaticField);
        System.out.println("子类--静态初始化块");
    }
    // 初始化块
    {
        System.out.println(sonField);
        System.out.println("子类--初始化块");
    }

    /**
     * 构造器
     */
    public SubSon(){
        System.out.println( "子类--构造器" );
    }
    public static void main(String[] args) {
        System.out.println("子类-----main方法");
        new SubSon();
    }
}
